//
//  RMShortNoteCollectionViewCell.m
//  RMNote
//
//  Created by 晓风残月 on 16/4/19.
//  Copyright © 2016年 lxf. All rights reserved.
//

#import "RMShortNoteCollectionViewCell.h"
#import "RMDateBaseManager.h"

#import "RMAppDelegate.h"

@interface RMShortNoteCollectionViewCell ()



@end

@implementation RMShortNoteCollectionViewCell

- (IBAction)LoveTheNote:(id)sender {
  
    if (self.model.isLove == 0) {
        [self.LoveButton setImage:[UIImage imageNamed:@"star1.png"] forState:(UIControlStateNormal)];
        self.model.isLove = YES;
        [[RMDateBaseManager defaultManager]updateNoteFromTableName:kRMShortNoteTable withModel:self.model byCreateDate:self.model.createDate];

    }else{
        [self.LoveButton setImage:[UIImage imageNamed:@"star2.png"] forState:(UIControlStateNormal)];
        self.model.isLove = NO;
        [[RMDateBaseManager defaultManager]updateNoteFromTableName:kRMShortNoteTable withModel:self.model byCreateDate:self.model.createDate];

    }
 
}
- (IBAction)deleteTheNote:(id)sender {
     [[RMDateBaseManager defaultManager]deleteNoteFromTableName:kRMShortNoteTable byCreateDate:self.createDate];
     self.reloaData();
}

- (void)awakeFromNib {
    // Initialization code
}

@end
